package main

import "fmt"

type subscriber struct {
	name   string
	rate   float64
	active bool
}

func printInfo(s *subscriber) {
	fmt.Println("subscriber name:", s.name)
	fmt.Println("subscriber rate:", s.rate)
	fmt.Println("subscriber active:", s.active)

}

func defaultSubcriber(name string) *subscriber {
	var s subscriber
	s.name = name
	s.rate = 1.234
	s.active = true
	return &s

}

func applyDescount(s *subscriber) {
	s.rate = 2.3456

}

func main() {
	sub1 := defaultSubcriber("hujianli1")
	applyDescount(sub1)
	printInfo(sub1)

	sub2 := defaultSubcriber("hujianli2")
	printInfo(sub2)
}
